package cn.handong.tool.沪房;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;


@Data
public class HouseData implements Comparable<HouseData> {
    //设置excel表头名称
    @ExcelProperty(value = "楼号",index = 0)
    private Integer buildingNumber;
    @ExcelProperty(value = "室号",index = 1)
    private String roomNumber;
    @ExcelProperty(value = "建筑面积",index = 2)
    private Double measure;
    @ExcelProperty(value = "单价",index = 3)
    private Integer unitPrice;
    @ExcelProperty(value = "总价",index = 4)
    private Integer totalPrice;
    @ExcelProperty(value = "楼层",index = 5)
    private Integer flourNumber;

    /**
     * 1、5楼及以上 优先横厅
     * 2、优先边套
     * 3、优先6号楼
     * 4 5楼及以上  先看6号楼  先01后04 从上往下排
     * @param o the object to be compared.
     * @return
     */
    @Override
    public int compareTo(HouseData o) {  //负数则把this放前

//        //同为6号楼   先01后04   同为01或04则从上往下
//        if (Objects.equals(this.getBuildingNumber(), o.getBuildingNumber()) && this.getBuildingNumber() == 6){
//            if (this.getRoomNumber().charAt(this.))
//        }

        return this.getTotalPrice() - o.getTotalPrice();
    }
}